package com.guapi.gwt.reference.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.DecoratedTabPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.guapi.gwt.api.client.GuardianApiService;
import com.guapi.gwt.api.client.GuardianApiServiceAsync;

public class GuapiGwtReference implements EntryPoint {

	
	private final GuardianApiServiceAsync apiService = GWT.create(GuardianApiService.class);

	public void onModuleLoad() {
		
		ContentApp contentApp = new ContentApp(apiService);
		SearchApp searchApp = new SearchApp(apiService);
		
		
		DecoratedTabPanel deck = new DecoratedTabPanel();
		deck.setWidth("100%");
		deck.add(searchApp, "Search");
		deck.add(contentApp, "Content");
		
		deck.setAnimationEnabled(true);
		deck.getTabBar().selectTab(0);
		RootPanel.get().add(deck);
		searchApp.click();
		
		
	}
	
	
}
